﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using HotelManagement._04.OBJECT;
using HotelManagement._03.DAO;

namespace HotelManagement._02.BUS
{
    class UserBUS
    {
        UserDAO m_UserDAO = new UserDAO();
        public DataTable ViewUser()
        {
            return m_UserDAO.ViewUser("pr_tblUser_SelectAll");
        }
        public string ViewRoleOfUser(int ip_Id)
        {
            return m_UserDAO.ViewRoleOfUser(ip_Id, "pr_tblUserRole");
        }
        public DataTable ViewUserById(int ip_Id)
        {
            return m_UserDAO.ViewUserById(ip_Id, "pr_tblUser_SelectRow");
        }
        public int ViewUserByAccount(string ip_user, string ip_password)
        {
            return m_UserDAO.ViewUserByAccount(ip_user, ip_password, "pr_tblUser_SelectAccount");
        }
        public bool AddUser(User ip_User)
        {
            return m_UserDAO.AddUser(ip_User, "pr_tblUser_Insert");
        }
        public bool UpdateUser(User ip_User)
        {
            return m_UserDAO.UpdateUser(ip_User, "pr_tblUser_Update");
        }
        public bool UpdatePassword(User ip_User)
        {
            return m_UserDAO.UpdatePassword(ip_User, "pr_tblUser_UpdatePassword");
        }
        public bool DeleteUser(User ip_User)
        {
            return m_UserDAO.DeleteUser(ip_User, "pr_tblUser_DeleteRow");
        }
        public DataTable SearchUser(string ip_KeyWord)
        {
            return m_UserDAO.SearchUser(ip_KeyWord, "pr_tblUser_Search");
        }
    }
}
